using B.S.Requst;
using MediatR;
using System.Collections.Generic;

namespace B.S.Data.MES.API.Applications.B.S.KApplications.Command.InvoiceCommand
{
    /// <summary>
    /// 更新销售发票命令
    /// 用于处理销售发票的更新请求
    /// </summary>
    public class UpdateSalesInvoiceCommand : IRequest<APIRequst<bool>>
    {
        /// <summary>
        /// 发票主键ID
        /// </summary>
        public int InvoiceId { get; set; }

        /// <summary>
        /// 发票编号
        /// </summary>
        public string InvoiceNo { get; set; }

        /// <summary>
        /// 关联的订单ID
        /// </summary>
        public int OrderId { get; set; }

        /// <summary>
        /// 客户ID
        /// </summary>
        public int CustomerId { get; set; }

        /// <summary>
        /// 发票金额
        /// </summary>
        public decimal InvoiceAmount { get; set; }

        /// <summary>
        /// 开票日期
        /// </summary>
        public System.DateTime InvoiceDate { get; set; }

        /// <summary>
        /// 发票类型
        /// </summary>
        public string InvoiceType { get; set; }

        /// <summary>
        /// 发票状态
        /// 0：待开具，1：已开具，2：已作废，3：已红冲
        /// </summary>
        public int InvoiceStatus { get; set; }

        /// <summary>
        /// 税率
        /// </summary>
        public decimal TaxRate { get; set; }

        /// <summary>
        /// 税额
        /// </summary>
        public decimal TaxAmount { get; set; }

        /// <summary>
        /// 不含税金额
        /// </summary>
        public decimal SubtotalAmount { get; set; }

        /// <summary>
        /// 备注信息
        /// </summary>
        public string Remarks { get; set; }

        /// <summary>
        /// 更新人
        /// </summary>
        public string UpdateName { get; set; }

        /// <summary>
        /// 发票明细列表
        /// </summary>
        public List<UpdateInvoiceDetailDto> InvoiceDetails { get; set; }
    }

    /// <summary>
    /// 发票明细更新DTO
    /// </summary>
    public class UpdateInvoiceDetailDto
    {
        /// <summary>
        /// 明细主键ID
        /// 如果为0，则表示新增明细
        /// </summary>
        public int DetailId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 数量
        /// </summary>
        public decimal Quantity { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        public decimal Amount { get; set; }

        /// <summary>
        /// 税率
        /// </summary>
        public decimal TaxRate { get; set; }

        /// <summary>
        /// 税额
        /// </summary>
        public decimal TaxAmount { get; set; }

        /// <summary>
        /// 不含税金额
        /// </summary>
        public decimal SubtotalAmount { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remarks { get; set; }

        /// <summary>
        /// 是否删除
        /// true: 删除该明细
        /// false: 保留或新增该明细
        /// </summary>
        public bool IsDelete { get; set; }
    }
}